<template lang="html">
  <div class="container-with-aside fade-transition">
    <nav-aside></nav-aside>
    <div class="tile is-parent">
      <article class="tile is-child box">
        <h1 class="title">商户交易统计</h1>
        <table class="table is-striped">
          <thead>
            <tr>
              <th>商户PID</th>
              <th>商户名称</th>
              <th>交易总金额</th>
            </tr>
          </thead>
          <tbody>
            <tr v-for="item in trdStatistics">
              <td>{{ item._id.merchant_pid }}</td>
              <td>{{ item._id.merchant_name }}</td>
              <td>{{ item.trd_amt | changeMoney}}</td>
            </tr>
          </tbody>
        </table>
      </article>
    </div>
  </div>
</template>

<script>
import NavAside from '../Common/NavAside.vue'
import {getTrdStatistics} from '../../vuex/actions/trd'
import {trdStatistics} from '../../vuex/getters/trd'
import {user} from '../../vuex/getters/token'
import datepicker from 'vue-datepicker/vue-datepicker-1.vue'
export default {
  data(){
    return{
      time: ""
    }
  },
  route:{
    data(){
      this.getTrdStatistics(this.user.operatorId);
    }
  },
  vuex: {
    getters: {
      trdStatistics,
      user
    },
    actions:{
      getTrdStatistics
    }
  },
  computed: {},
  mounted () {},
  methods: {},
  components: {
    NavAside,
    datepicker
  }
}
</script>

<style lang="css">
</style>
